package Model2HomeWork;
//实体类的优化 将通话套餐类和上网套餐类中相同的特征和行为提取出来组成抽象套餐类。
public abstract class Plan {
    private int price;

    public Plan() {
    }

    public Plan(int price) {
       setPrice(price);
    }
    //getter and setter
    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        if(price>=0){

        this.price = price;

        }else{
            System.out.println("资费不能小于0!!");
        }

    }

    //自定义抽象方法
    public abstract void getPayment();
}
